package com.nationart.backend.controller;


import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.plugins.Page;
import com.nationart.backend.entity.SysLog;
import com.nationart.backend.service.SysLogService;
import com.nationart.backend.util.PageVariable;
import com.nationart.backend.util.Response;


/**
 * <p>
 * 系统日志 前端控制器
 * </p>
 *
 * @author Administrator
 * @since 2018-11-08
 */
@RestController
@RequestMapping("/sys/log")
public class SysLogController {
	@Autowired
	private SysLogService sysLogService;
	
	/**
	 * 列表
	 */
	@ResponseBody
	@RequestMapping("/list")
	@RequiresPermissions("sys:log:list")
	public Response list(@RequestParam Map<String, Object> params){
		//查询列表数据
		PageVariable query = new PageVariable(params);
		Page<SysLog> pageUtil = new Page<SysLog>(query.getPage(), query.getLimit());
		
		Page<SysLog> page = sysLogService.selectPageList(pageUtil,query);
		
		return Response.ok().put("page", page);
	}
}
